//
//  JFBOrderDetailDS.h
//  ios-supplier
//
//  Created by feynmanyuan on 15/4/16.
//  Copyright (c) 2015年 feynmanyuan. All rights reserved.
//

/*
 "active_price" = "<null>";
 "buy_quantity" = 0;
 "category1_id" = 23;
 "inventory_qty" = 999;
 "model_name" = "\U76d2";
 "product_id" = 4794;
 "product_name" = "KFC\U4e13\U4eab--\U4f73\U6c9b\U7eff\U5947\U5f02\U679c  ";
 "product_price" = 30;
 "shop_id" = 1733;
 "shop_price" = 30;
 shoppingCount = 0;
 status = 1;
 "weight_name" = "";
 "weight_value" = "6\U7c92";
 
 "mpId": 1,                   商品id
 "name": "商品010",           商品名称（中文名）
 "calculationUnit": "0个",    单位
 "mpStatus": 0,               商品状态
 "stockNum": 10,              库存量
 "saleType": 3,               销售类型
 "mpURL": "include/images/1.jpg",       商品图片
 "marketPrice": 18,             市场价格
 "storePrice": 20,              门店价格
 "weight": "10.0kg"             重量
 */

#import <Foundation/Foundation.h>

@interface JFBMerchandiseDS : NSObject
//商品ID
@property (nonatomic, assign) NSUInteger mpId;
// 商品名称
@property (nonatomic, strong) NSString *name;
// 单位
@property (nonatomic, strong) NSString *calculationUnit;
// 商品状态，是否上架  4：上架  5：下架  -1：全部
@property (nonatomic, assign) NSInteger mpStatus;
// 库存量
@property (nonatomic, assign) NSInteger stockNum;
//销售类型   3：本来精选 1：通货
@property (nonatomic, assign) NSInteger saleType;
// 商品图片
@property (nonatomic, strong) NSString *mpURL;
// 市场价格
@property (nonatomic, strong) NSDecimalNumber *marketPrice;
// 门店价格
@property (nonatomic, strong) NSDecimalNumber *storePrice;//
// 规格
@property (nonatomic, strong) NSString *standard;
// 总数
@property (nonatomic, assign) NSUInteger total;
// 分类下上架商品数
@property (nonatomic, assign) NSUInteger shelvesNum;
//分类下已下架商品数
@property (nonatomic, assign) NSUInteger pullOffShelvesNum;
//@property (nonatomic, assign) NSUInteger count;

//@property (nonatomic, assign) NSInteger shop_id;

//@property (nonatomic, assign) NSInteger type; // 1是赠品，0不是赠品



- (instancetype)initWithAttributes:(NSDictionary *)attributes;
- (instancetype)initWithOrderListAttributes:(NSDictionary *)attributes;

+ (NSURLSessionDataTask *)loadMerchandiseList:(void (^)(NSArray *merchandiseList, NSError *error))block categoryId:(NSUInteger)categoryId ut:(NSString *)ut pager:(JFBPager*)pager;

+ (NSURLSessionDataTask *)scanQuery:(void (^)(JFBMerchandiseDS *merchandise, NSError *error))block code:(NSString*)code;

//+ (NSURLSessionDataTask *)switchUpAndDownShelf:(void (^)(BOOL isSuccess, NSError *error))block merchandiseID:(NSUInteger)merchandiseID status:(NSUInteger)status;
+ (NSURLSessionDataTask *)switchUpAndDownShelf:(void (^)(BOOL isSuccess, NSError *error))block merchandiseID:(NSUInteger)merchandiseID oldStatus:(NSInteger)oldStatus newStatus:(NSInteger)newStatus saleType:(NSInteger)saleType;
+ (NSURLSessionDataTask *)changeUnitPrice:(void (^)(BOOL isSuccess, NSString *message, NSError *error))block merchandiseID:(NSUInteger)merchandiseID price:(NSDecimalNumber*)price status:(NSUInteger)status;

+ (NSURLSessionDataTask *)search:(void (^)(NSArray *merchandiseList, NSUInteger onlineCount, NSUInteger offlineCount, NSError *error))block name:(NSString*)name showType:(NSUInteger)showType;

+ (NSURLSessionDataTask *)batchUpAndDownShelf:(void (^)(BOOL isSuccess, NSString *message, NSError *error))block productIds:(NSString*)productIds optFlag:(NSUInteger)optFlag;

+ (NSURLSessionDataTask *)changeUnitPrice:(void (^)(BOOL isSuccess, NSString *message, NSError *error))block  mpId:(NSUInteger)mpId realStockNum:(NSUInteger)realStockNum addstockNum:(NSDecimalNumber*)addstockNum storePrice:(NSDecimalNumber*)storePrice oldStatus:(NSInteger)oldStatus newStatus:(NSInteger)newStatus saleType:(NSInteger)saleType;
@end
